from django.db import models

from myuser.models import MyUser
from prj005.models.info import Info
from prj005.models.models import CreateTimeModel


class Clinical(CreateTimeModel):
    owner = models.ForeignKey(MyUser, on_delete=models.CASCADE, related_name='prj005_clinical')

    info = models.OneToOneField(Info, on_delete=models.CASCADE, related_name='clinical')

    herbalist_pen = models.BooleanField(blank=True, null=True, verbose_name='盆腔炎', help_text='盆腔炎')

    herbalist_fu = models.BooleanField(blank=True, null=True, verbose_name='妇人腹痛', help_text='妇人腹痛')

    herbalist_re = models.BooleanField(blank=True, null=True, verbose_name='热入血室', help_text='热入血室')

    herbalist_jing = models.BooleanField(blank=True, null=True, verbose_name='痛经', help_text='痛经')

    herbalist_dai = models.BooleanField(blank=True, null=True, verbose_name='带下病', help_text='带下病')

    herbalist_xia = models.BooleanField(blank=True, null=True, verbose_name='癥瘕', help_text='癥瘕')

    herbalist_yun = models.BooleanField(blank=True, null=True, verbose_name='不孕症', help_text='不孕症')

    herbalist_bu = models.BooleanField(blank=True, null=True, verbose_name='月经不调', help_text='月经不调')

    herbalist_bu_xian = models.BooleanField(blank=True, null=True, verbose_name='月经先期', help_text='月经先期')

    herbalist_bu_duo = models.BooleanField(blank=True, null=True, verbose_name='月经过多', help_text='月经过多')

    herbalist_bu_yan = models.BooleanField(blank=True, null=True, verbose_name='经期延长', help_text='经期延长')

    herbalist_bu_lou = models.BooleanField(blank=True, null=True, verbose_name='崩漏', help_text='崩漏')

    herbalist_bu_hou = models.BooleanField(blank=True, null=True, verbose_name='月经后期', help_text='月经后期')

    herbalist_bu_shao = models.BooleanField(blank=True, null=True, verbose_name='月经过少', help_text='月经过少')

    herbalist_qita = models.CharField(max_length=50, blank=True, null=True, verbose_name='中医诊断-其他', help_text='中医诊断-其他')

    DISCRIMINATE_SHI_CHOICES = (
        ('热毒炽盛证', '热毒炽盛证'),
        ('湿毒壅盛证', '湿毒壅盛证'),
        ('湿热蕴结证', '湿热蕴结证'),
        ('瘀热内结证', '瘀热内结证'),
        ('湿热瘀结证', '湿热瘀结证'),
        ('气滞血瘀证', '气滞血瘀证'),
        ('寒湿瘀阻证', '寒湿瘀阻证'),
        ('其他', '其他')
    )
    discriminate_shi = models.CharField(max_length=8, choices=DISCRIMINATE_SHI_CHOICES, blank=True, null=True, verbose_name='实证', help_text='实证')

    discriminate_shi_qita = models.CharField(max_length=50, blank=True, null=True, verbose_name='实证-其他', help_text='实证-其他')

    DISCRIMINATE_XUSHI_CHOICES = (
        ('气虚血瘀证', '气虚血瘀证'),
        ('肾虚血瘀证', '肾虚血瘀证'),
        ('其他', '其他')
    )
    discriminate_xushi = models.CharField(max_length=8, choices=DISCRIMINATE_XUSHI_CHOICES, blank=True, null=True, verbose_name='虚实夹杂证', help_text='虚实夹杂证')

    discriminate_xushi_qita = models.CharField(max_length=50, blank=True, null=True, verbose_name='虚实夹杂证-其他', help_text='虚实夹杂证-其他')

    WESTERN_CHOICES = (
        ('盆腔炎性疾病', '盆腔炎性疾病'),
        ('盆腔炎性疾病后遗症', '盆腔炎性疾病后遗症'),
        ('其他', '其他'),
    )
    western = models.CharField(max_length=12, choices=WESTERN_CHOICES, blank=True, null=True, verbose_name='西医诊断', help_text='西医诊断')

    western_qita = models.CharField(max_length=50, blank=True, null=True, verbose_name='西医诊断-其他', help_text='西医诊断-其他')

    western_houyi_man = models.BooleanField(blank=True, null=True, verbose_name='慢性盆腔痛', help_text='慢性盆腔痛')

    western_houyi_pen = models.BooleanField(blank=True, null=True, verbose_name='盆腔炎性疾病反复发作', help_text='盆腔炎性疾病反复发作')

    western_houyi_bu = models.BooleanField(blank=True, null=True, verbose_name='不孕', help_text='不孕')

    western_houyi_yi = models.BooleanField(blank=True, null=True, verbose_name='异位妊娠', help_text='异位妊娠')

    repeat_one_t = models.BooleanField(blank=True, null=True, verbose_name='1年内发作次数-≤2次', help_text='1年内发作次数-≤2次')

    repeat_one_f = models.BooleanField(blank=True, null=True, verbose_name='1年内发作次数-3-5次', help_text='1年内发作次数-3-5次')

    repeat_one_e = models.BooleanField(blank=True, null=True, verbose_name='1年内发作次数-疼痛持续存在3月以上', help_text='1年内发作次数-疼痛持续存在3月以上')

    repeat_one_s = models.BooleanField(blank=True, null=True, verbose_name='1年内发作次数-疼痛持续存在6月以上', help_text='1年内发作次数-疼痛持续存在6月以上')

    repeat_two_t = models.BooleanField(blank=True, null=True, verbose_name='2年内发作次数-3-5次', help_text='2年内发作次数-3-5次')

    repeat_two_f = models.BooleanField(blank=True, null=True, verbose_name='2年内发作次数-大于5次', help_text='2年内发作次数-大于5次')

    repeat_total = models.IntegerField(blank=True, null=True, verbose_name='发病以来共发作次数', help_text='发病以来共发作次数')

    western_how_long = models.CharField(max_length=20, blank=True, null=True, verbose_name='盆腔炎病程', help_text='盆腔炎病程')

    western_first_time = models.CharField(max_length=20, blank=True, null=True, verbose_name='初次发病时间', help_text='初次发病时间')

    class Meta:
        verbose_name = '临床治疗'
        verbose_name_plural = verbose_name
